package result

import "errors"

type ResultCode struct {
	Code string
	Msg  string
}

var (
	SUCCESS        = ResultCode{"SUCCESS", "success"}
	PARAMS_INVALID = ResultCode{"PARAMS_INVALID", "params_invalid"}
)

func NewError(r ResultCode) error {
	return errors.New(r.Code)
}

func NewErrorWithCode(code string) error {
	return errors.New(code)
}
